package com.tjetc._7date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;
import java.util.Date;

public class _1Date {
    public static void main(String[] args) throws ParseException {
        Date date = new Date();
        System.out.println(date);

        Date date1 = new Date(68456132897454L);
        System.out.println(date1);

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        String format = simpleDateFormat.format(date);
        System.out.println(format);

        String date2 = "2023-5-20 18:28:00";
        Date date3 = simpleDateFormat.parse(date2);
        System.out.println(date3);

    }
}
